package com.clothing.customization.repository;

import com.clothing.customization.entity.MaterialInventory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

/**
 * 面料库存数据访问层
 */
@Repository
public interface MaterialInventoryRepository extends JpaRepository<MaterialInventory, Long>, JpaSpecificationExecutor<MaterialInventory> {
    
    /**
     * 根据面料编号查询
     */
    boolean existsByMaterialCode(String materialCode);
    
    /**
     * 根据面料编号查询（排除指定ID）
     */
    boolean existsByMaterialCodeAndIdNot(String materialCode, Long id);
} 